# encoding=utf8
from selenium import webdriver

import selenium
from time import sleep


# 1.创建Chrome浏览器对象，这会在电脑上在打开一个浏览器窗口
driver_path = "F:\\Chrome Download\\Driver\\chromedriver.exe"		# webdriver地址
web_url = "https://www.douyin.com/video/6939208589324176671"		# 目标网页url
plugin_path = "C:\\Users\\Johnh\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\ncennffkjdiamlpmcbajkmaiiiddgioo\\3.27_0"		# 迅雷下载插件地址
argument = "--load-extension=" + plugin_path
options = webdriver.ChromeOptions()
options.add_argument(argument)
browser = webdriver.Chrome(executable_path=driver_path, chrome_options=options)

# 2.通过浏览器向服务器发送URL请求
browser.get(web_url)
# # 3.刷新浏览器
# browser.refresh()
# 4.设置浏览器的大小
browser.set_window_size(1400, 800)
# 5.设置链接内容
element = browser.find_element_by_id("xl_chrome_ext_download")
element.click()

